/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package swing.dialog;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;

/**
 *
 * @author Administrator
 */
public class JDialogTest extends JFrame
{
  AddressDialog dialog = new AddressDialog(this, false);
  public JDialogTest(String title)
  {
    super(title);
    init();
  }
  public JDialogTest()
  {
    super();
    init();
  }

  private void init()
  {
    this.getContentPane().setLayout(new FlowLayout());
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    final AddressDialog d = new AddressDialog(this, false);
    JButton button = new JButton("Show Dialog..");
    button.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e)
      {
        d.setSize(250, 120);
        d.setVisible(true);
      }
    });
    this.getContentPane().add(button);
  }
  public static void main(String[] args)
  {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JDialog.setDefaultLookAndFeelDecorated(true);
    JDialogTest dialogTest = new JDialogTest();
    dialogTest.pack();
    dialogTest.setVisible(true);
  }
}
